package com.thy.feign;

import com.hospital.common.base.Result;
import com.hospital.common.config.FeignConfig;
import com.hospital.common.pojo.TDepartment;
import com.hospital.common.pojo.TDoctorInfo;
import com.hospital.common.pojo.TUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "data-simulation",configuration = FeignConfig.class)
public interface DataSimulationFeign {
    /**
     * 添加用户
     * @param user
     * @return
     */
    @PostMapping("/user/add")
    Result<Long> addUser(@RequestBody TUser user);
    /**
     * 删除用户
     * @param id
     * @return
     */
    @DeleteMapping("/user/delete")
    Result<?> deleteUser(@RequestParam("id") Long id);
    /**
     * 更新用户
     * @param user
     * @return
     */
    @PostMapping("/user/update")
    Result<?> updateUser(@RequestBody TUser user);

    /**
     * 添加医生信息
     * @return 添加的医生信息ID
     */
    @PostMapping("/doctorInfo/add")
    Result<Long> addDoctorInfo(@RequestBody TDoctorInfo doctorInfo);

    /**
     * 删除医生信息
     * @param id 医生信息ID
     */
    @PostMapping("/doctorInfo/delete")
    Result<?> deleteDoctorInfo(@RequestParam("id") Long id);

    /**
     * 更新医生信息
     * <br>
     * 更新信息中必须带有id
     * @param doctorInfo 医生信息
     */
    @PostMapping("/doctorInfo/update")
    Result<?> updateDoctorInfo(@RequestBody TDoctorInfo doctorInfo);
    /**
     * 添加科室
     */
    @PostMapping("/department/add")
    Result<Long> addDepartment(@RequestBody TDepartment department);
}
